home *** CD-ROM | disk | FTP | other *** search
- unit Syntsum2;
- { PC Plus - learning Pascal with Delphi
- lesson 2.
- Syntax summary }
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Button2: TButton;
- Button3: TButton;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure ChangeCaption;
- begin
- Form1.Caption := 'Wheee!';
- end;
-
- procedure NewCaption( nc, nc2 : string );
- { arguments must be listed along with their type.
- arguments of the same type can be separated by commas: e.g.
- ( i, x : integer );
- different types or arguments are separated by semi-colons: e.g.
- ( i, x : integer; s : string );
- }
- begin
- Form1.Caption := nc + nc2;
- end;
-
- function TheFormCaption : string;
- begin
- TheFormCaption := Form1.Caption;
- end;
-
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- NewCaption( 'Hello', ' world' );
- end;
-
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- ChangeCaption;
- end;
-
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- Button3.Caption := TheFormCaption;
- end;
-
- end.
-